package com.passer.network.constant;

import com.amihaiemil.eoyaml.Yaml;
import com.amihaiemil.eoyaml.YamlMapping;
import lombok.Getter;

import java.io.IOException;
import java.io.InputStream;

@Getter
public class WlanProperties {

    private final String wlanFilePath;

    private final String wlanProfileTemplate;

    public WlanProperties() {
        YamlMapping yamlMapping;
        try(InputStream resourceAsStream = WlanProperties.class.getResourceAsStream("/toolbox-wlan.yaml")) {
            yamlMapping = Yaml.createYamlInput(resourceAsStream).readYamlMapping();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        this.wlanFilePath = yamlMapping.string("wlan-file-path");
        this.wlanProfileTemplate = yamlMapping.string("wlan-profile-template");
    }

}
